<%@ include file="template/CommonHeader.jsp" %>
<link href="/FMTOOL_WEB/resources/plugins/tables/dataTables/jquery.dataTables.css" type="text/css" rel="stylesheet" />

    <div id="wrapper">
        <%@ include file="template/LeftNavigator.jsp" %>


        <!--Body content-->
        <div id="content" class="clearfix">
            <div class="contentwrapper"><!--Content wrapper-->

                <%@ include file="template/PageHeader.jsp" %>

                <!-- Build page from here: -->
                <%@ include file="template/CommonSuccessMessage.jsp" %>
                <%@ include file="template/CommonErrorMessage.jsp" %>
                
                <div class="row-fluid">
                      
                       
                        <div class="span9">

                            <div class="box gradient">

                                <div class="title">
                                    <h4>
                                        <span>Node Hierarchy Management</span>
										<button class="btn btn-primary btn-mini nonMobile" href="#" onClick="window.location='newNodeForm.action'" style="float:right;margin-right:40px;">New Node</button>
                                    </h4>
									
                                </div>
                                <div class="content noPad clearfix" id="nodeHierarchyDiv">
                                     
                                  
                                </div>

                            </div><!-- End .box -->

                        </div><!-- End .span9 -->
                        
                        <div class="span3">

                            <div class="box">

                                <div class="title">

                                    <h4>
                                        <span class="icon16 icomoon-icon-list-view"></span>
                                        <span>Segment Selection</span>
                                    </h4>
                                    <a href="#" class="minimize">Minimize</a>
                                </div>
                                <div class="content">
                                    <select  name="user.userTypeId" id="segmentId" class="nostyle" style="width:100%;" onchange="fetchNodeHierarchy(this.value)">
                                    		<option value="none">Select a Segment</option>
                                  		<s:iterator value="segmentList" id="segmentLst">
                                  	   	    <option value="<s:property value="segmentId" />"><s:property value="segmentName" /></option>
				     					</s:iterator>
	                                 </select>
                                </div>

                            </div><!-- End .box -->

                        </div><!-- End .span3 -->
                        

                    </div><!-- End .row-fluid -->

                <!-- End page Content: -->
                
            </div>
            <!-- End contentwrapper -->
        </div><!-- End #content -->


    </div><!-- End #wrapper -->
    
 
  

<%@ include file="template/CommonJS.jsp" %>    

 <script type="text/javascript" src="/FMTOOL_WEB/resources/plugins/tables/dataTables/jquery.dataTables.min.js"></script>
 <script type="text/javascript" src="/FMTOOL_WEB/resources/plugins/tables/responsive-tables/responsive-tables.js"></script><!-- Make tables responsive -->
 <script type="text/javascript" src="/FMTOOL_WEB/resources/js/datatable.js"></script><!-- Init plugins only for page -->
 <script type="text/javascript">
  function fetchNodeHierarchy(segmentId)
  {
    if(segmentId=="none")
     return;
    $("#nodeHierarchyDiv").html("<img src='/FMTOOL_WEB/resources/images/loaders/circular/011.gif' border='0' />");
			  		  var x= $.ajax({
    		  		  url: "nodeHierarchyList.action",
			  		  type: 'POST',
		      		  async: false,
			  		  data: "segmentId=" +segmentId
			  		  }).responseText;
				
				      
				      $("#nodeHierarchyDiv").html(x);
  }
  
  function fetchParentNodeSelectBox(segmentId,divId,parentNodeId)
		  {
		    if(segmentId=="none")
		       return;
		    
		    $("#"+divId).html("<img src='/FMTOOL_WEB/resources/images/loaders/circular/011.gif' border='0' />");
					  		  var x= $.ajax({
		    		  		  url: "parentNodeListString.action",
					  		  type: 'POST',
				      		  async: false,
					  		  data: "segmentId=" +segmentId+"&parentNode="+parentNodeId
					  		  }).responseText;
						      
			$("#"+divId).html(x);
		  }
		  
		  
   function editNode(formSerial)
  {
   document.getElementById("editForm"+formSerial).submit();
  }
		  
 </script>
    
		 
<%@ include file="template/CommonFooter.jsp" %>    

